import java.lang.reflect.Array;
import java.util.Arrays;

public class Leet475 {
    public static void main(String[] args) {
        Leet475 l = new Leet475();
        System.out.println(l.findRadius(new int[]{1,2,2,3},
                new int[]{1,2,2,3}));
    }

    public int findRadius(int[] houses, int[] heaters) {
        Arrays.sort(houses);
        Arrays.sort(heaters);
        int i = 0,min = 0;
        for (int house : houses) {
            while (i < heaters.length - 1 && Math.abs(heaters[i] - house) >= Math.abs(heaters[i + 1] - house)) i++;
            min = Math.max(min, Math.abs(heaters[i] - house));
        }
        return min;
    }

}
